#include "stdafx.h"
#include "CClycloPentane.h"


CClycloPentane::CClycloPentane(void)
{
}


CClycloPentane::CClycloPentane(CPoint pBegin, CPoint pEnd)
{
	this->m_pBegin	= pBegin;
	this->m_pEnd	= pEnd;
	m_nAngle = NUM_OF_ANGLE;
	m_pCoordinates = new CPoint[NUM_OF_ANGLE];
	m_cPenColor = RGB(0, 0, 0);
	m_brushColor.CreateSolidBrush(RGB(255, 255, 255));
	m_nPenStyle = PS_SOLID;
	m_nPenWidth = 2;
}

BOOL CClycloPentane::Draw(CDC *cDC)
{
	lengthSide = sqrt( ( m_pBegin.x -  m_pEnd.x ) * ( m_pBegin.x -  m_pEnd.x ) 
						+ ( m_pBegin.x -  m_pEnd.x ) * ( m_pBegin.x -  m_pEnd.x ));
	radiansOffset = DegreesToRadians(270);
	CPen cPen(m_nPenStyle, m_nPenWidth, m_cPenColor);
	cDC->SelectObject(&m_brushColor);
	CPen *pOldPen = cDC->SelectObject(&cPen);
	this->setCoordinate();
	cDC->Polygon(m_pCoordinates, NUM_OF_ANGLE);
	cDC->SelectObject(pOldPen);
	pOldPen->DeleteObject();
	return	FALSE;
}

CClycloPentane::~CClycloPentane(void)
{
}
